//
//  UILabel+quickInit.swift
//  SYWeibo
//
//  Created by Saya on 16/4/12.
//  Copyright © 2016年 黄金果. All rights reserved.
//

import UIKit

extension UILabel{
    convenience init(text:String,font:CGFloat,textColor:UIColor,margin:CGFloat = 0){
        self.init()
        self.text = text
        self.font = UIFont.systemFontOfSize(font)
        self.textColor = textColor
        self.sizeToFit()
        self.numberOfLines = 0
        self.textAlignment = .Center
        
        if margin > 0{
            self.preferredMaxLayoutWidth = UIScreen.mainScreen().bounds.width - 2*margin
            self.textAlignment = .Left
        }
    }
}


